  function [a,b,mx,sdx,x]=u_msd2ab(mu,sd,t);
% =========================================  
% function [a,b,mx,sdx,x]=u_msd2ab(mu,sd,t)
%
% Find the A amd B in the uniform distribution specified 
% by MU and SD 
% Call with T=[] to avoid the simulation 
% =========================================
b = mu + sqrt(12)*sd/2 ;
a = 2*mu-b;
if b < a
    error('B less than A in uniform');
end
if nargin < 3 
    t = 20000; 
else 
    if ~isempty(t); 
        x=unifrnd(a,b,t,1);
        mx=mean(x);
        sdx=std(x);
        disp(['Mean, ',num2str(mx),' & std ',num2str(sdx)]);
    end 
end 